package com.hnevc.androidui6;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    Button mBtnButton1;//保存控件
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.e(TAG, "onCreate: " );

mBtnButton1=findViewById(R.id.btn_button1);
mBtnButton1.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        //启动activity
     /*   Intent intent=new Intent(MainActivity.this,LoginActivity.class);
        startActivity(intent);
        */
        Intent intent =new Intent();
        intent.setAction("com.hnevc.SHOW");
        startActivity(intent);

    }
});
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.e(TAG, "onStart: " );
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.e(TAG, "onResume: " );
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.e(TAG, "onPause: " );
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.e(TAG, "onStop: " );
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.e(TAG, "onDestroy: " );
    }
}
